"""
账单相关模型
"""

from jlpay.model.base import OrgBaseReq, BaseResponse


# ==================== 账单申请URL ====================
class BillApplyUrlRequest(OrgBaseReq):
    """账单申请URL请求"""
    
    API_URL = "/open/ledger/bill/apply/url"
    
    def __init__(self):
        """初始化账单申请URL请求"""
        super().__init__()
        self.org_code = None
        self.bill_date = None
    
    def set_org_code(self, org_code):
        """
        设置机构代码
        
        Args:
            org_code: 机构代码
            
        Returns:
            BillApplyUrlRequest实例
        """
        self.org_code = org_code
        return self
    
    def set_bill_date(self, bill_date):
        """
        设置账单日期
        
        Args:
            bill_date: 账单日期
            
        Returns:
            BillApplyUrlRequest实例
        """
        self.bill_date = bill_date
        return self


class BillApplyUrlResponse(BaseResponse):
    """账单申请URL响应"""
    
    def __init__(self, response_dict=None):
        """
        初始化账单申请URL响应
        
        Args:
            response_dict: 响应字典
        """
        super().__init__(response_dict)
        self.org_code = None
        self.download_url = None
        
        if response_dict:
            self.org_code = response_dict.get('org_code')
            self.download_url = response_dict.get('download_url') 